package com.bt7274.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 用户考核记录表：记录用户参与考核
 * @TableName assessment
 */
@TableName(value ="assessment")
@Data
public class Assessment {
    /**
     * 
     */
    @TableId
    private String id;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 规则id
     */
    private String ruleId;

    /**
     * 当前指标值
     */
    private float currentValue;

    /**
     * 是否通过
     */
    private Integer isPassed;

    /**
     * 实际执行的惩罚
     */
    private String penaltyApplied;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 考核时间
     */
    private LocalDateTime assessedTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Assessment other = (Assessment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getRuleId() == null ? other.getRuleId() == null : this.getRuleId().equals(other.getRuleId()))
            && (this.getCurrentValue() == 0 ? other.getCurrentValue() == 0 : this.getCurrentValue() == (other.getCurrentValue()))
            && (this.getIsPassed() == null ? other.getIsPassed() == null : this.getIsPassed().equals(other.getIsPassed()))
            && (this.getPenaltyApplied() == null ? other.getPenaltyApplied() == null : this.getPenaltyApplied().equals(other.getPenaltyApplied()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
            && (this.getAssessedTime() == null ? other.getAssessedTime() == null : this.getAssessedTime().equals(other.getAssessedTime()));
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", ruleId=").append(ruleId);
        sb.append(", currentValue=").append(currentValue);
        sb.append(", isPassed=").append(isPassed);
        sb.append(", penaltyApplied=").append(penaltyApplied);
        sb.append(", remarks=").append(remarks);
        sb.append(", assessedTime=").append(assessedTime);
        sb.append("]");
        return sb.toString();
    }
}